package basic;

/**
 * @Author: 海琳琦
 * @Date: 2021/8/30 21:06
 */
public class Title9 {
    public static void main(String[] args) {

    }
    private static boolean isPalindrome(int x) {
        //整形转化为String类型占用额外的空间
        if(x<0||(x%10==0&&x!=0)){
            return false;
        }
        int reverseNumber = 0;
        while(x >reverseNumber){
            reverseNumber = reverseNumber * 10 + x%10;
            x/=10;
        }
        return x==reverseNumber || x ==reverseNumber/10;
    }
}
